package GUILayer;
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.BevelBorder;
import javax.swing.border.TitledBorder;
import javax.swing.UIManager;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.border.MatteBorder;
import java.awt.Color;
import javax.swing.AbstractListModel;
import java.awt.Font;


public class Salg extends JFrame {

	private JPanel contentPane;
	private JTextField saleFindCustomerText;
	private JTextField saleFindItemText;
	private final JLabel lblNewLabel = new JLabel("Kunde");
	private JTable saleAddCustomerTable;
	private JTable saleAddItemTable;
	private JTable saleListTable;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Salg frame = new Salg();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Salg() {
		setTitle("SALG");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 800, 600);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel saleAddCustomerPanel = new JPanel();
		saleAddCustomerPanel.setBounds(10, 11, 350, 269);
		contentPane.add(saleAddCustomerPanel);
		saleAddCustomerPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Tilf\u00F8je kunde til salget", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		saleAddCustomerPanel.setLayout(null);
		
		JButton saleAddCustomerButton = new JButton("Tilf\u00F8je Kunde");
		saleAddCustomerButton.setBounds(229, 235, 111, 23);
		saleAddCustomerPanel.add(saleAddCustomerButton);
		
		JButton saleFindCustomerButton = new JButton("Find Kunde");
		saleFindCustomerButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		saleFindCustomerButton.setBounds(140, 48, 105, 23);
		saleAddCustomerPanel.add(saleFindCustomerButton);
		
		JLabel saleFindCustomerLabel = new JLabel("Find kunde");
		saleFindCustomerLabel.setBounds(10, 35, 126, 14);
		saleAddCustomerPanel.add(saleFindCustomerLabel);
		
		saleFindCustomerText = new JTextField();
		saleFindCustomerText.setColumns(10);
		saleFindCustomerText.setBounds(10, 49, 120, 20);
		saleAddCustomerPanel.add(saleFindCustomerText);
		
		JButton saleCustomerClearSearchButton = new JButton("Nulstil ");
		saleCustomerClearSearchButton.setBounds(255, 48, 88, 23);
		saleAddCustomerPanel.add(saleCustomerClearSearchButton);
		
		saleAddCustomerTable = new JTable();
		saleAddCustomerTable.setBounds(10, 80, 330, 144);
		saleAddCustomerPanel.add(saleAddCustomerTable);
		
		JPanel saleAddItemsPanel = new JPanel();
		saleAddItemsPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Tilf\u00F8je varer til salget", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		saleAddItemsPanel.setBounds(10, 291, 350, 260);
		contentPane.add(saleAddItemsPanel);
		saleAddItemsPanel.setLayout(null);
		
		JButton saleAddItemButton = new JButton("Tilf\u00F8je Vare");
		saleAddItemButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		saleAddItemButton.setBounds(200, 11, 111, 23);
		saleAddItemsPanel.add(saleAddItemButton);
		
		JLabel saleFindItemLabel = new JLabel("Find Vare");
		saleFindItemLabel.setBounds(10, 29, 124, 14);
		saleAddItemsPanel.add(saleFindItemLabel);
		
		saleFindItemText = new JTextField();
		saleFindItemText.setColumns(10);
		saleFindItemText.setBounds(10, 43, 124, 20);
		saleAddItemsPanel.add(saleFindItemText);
		
		JButton saleFindItemButton = new JButton("Find Vare");
		saleFindItemButton.setBounds(144, 42, 98, 23);
		saleAddItemsPanel.add(saleFindItemButton);
		
		JButton saleItemClearSearchButton = new JButton("Nulstil ");
		saleItemClearSearchButton.setBounds(252, 42, 88, 23);
		saleAddItemsPanel.add(saleItemClearSearchButton);
		
		saleAddItemTable = new JTable();
		saleAddItemTable.setBounds(10, 74, 330, 144);
		saleAddItemsPanel.add(saleAddItemTable);
		
		JPanel SalePanel = new JPanel();
		SalePanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Salget", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		SalePanel.setBounds(370, 11, 404, 481);
		contentPane.add(SalePanel);
		SalePanel.setLayout(null);
		lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblNewLabel.setBounds(10, 74, 119, 31);
		SalePanel.add(lblNewLabel);
		
		JLabel lblMedarbejder = new JLabel("Medarbejder");
		lblMedarbejder.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblMedarbejder.setBounds(10, 32, 119, 31);
		SalePanel.add(lblMedarbejder);
		
		JLabel lblTilfjedeVarer = new JLabel("Tilf\u00F8jede Varer i Salget");
		lblTilfjedeVarer.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblTilfjedeVarer.setBounds(10, 116, 384, 22);
		SalePanel.add(lblTilfjedeVarer);
		
		JLabel lblSamletPris = new JLabel("Samlet Pris");
		lblSamletPris.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblSamletPris.setBounds(10, 384, 128, 22);
		SalePanel.add(lblSamletPris);
		
		JLabel lblKundensRabat = new JLabel("Kundens Rabat");
		lblKundensRabat.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblKundensRabat.setBounds(10, 408, 128, 22);
		SalePanel.add(lblKundensRabat);
		
		JLabel lblTotalRabat = new JLabel("Total rabat");
		lblTotalRabat.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblTotalRabat.setBounds(10, 431, 128, 22);
		SalePanel.add(lblTotalRabat);
		
		JButton btnBetaling = new JButton("Betaling");
		btnBetaling.setBounds(235, 434, 111, 23);
		SalePanel.add(btnBetaling);
		
		JButton btnAnnulereSalget = new JButton("Annulere Salget");
		btnAnnulereSalget.setBounds(213, 387, 111, 23);
		SalePanel.add(btnAnnulereSalget);
		
		JLabel lbldkr_1 = new JLabel("0DKR");
		lbldkr_1.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lbldkr_1.setBounds(148, 431, 246, 22);
		SalePanel.add(lbldkr_1);
		
		JLabel label_1 = new JLabel("0%");
		label_1.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_1.setBounds(148, 408, 246, 22);
		SalePanel.add(label_1);
		
		JLabel lbldkr = new JLabel("0DKR");
		lbldkr.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lbldkr.setBounds(148, 384, 246, 22);
		SalePanel.add(lbldkr);
		
		JLabel lblPerson = new JLabel("PERSON");
		lblPerson.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblPerson.setBounds(133, 74, 119, 31);
		SalePanel.add(lblPerson);
		
		JLabel lblAnsat = new JLabel("ANSAT");
		lblAnsat.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblAnsat.setBounds(133, 32, 119, 31);
		SalePanel.add(lblAnsat);
		
		saleListTable = new JTable();
		saleListTable.setBounds(10, 141, 384, 232);
		SalePanel.add(saleListTable);
	}
}
